<?php
namespace app\api\validate;

class Post extends \think\Validate
{
    /**
     * 验证规则
     */
    protected $rule = [
        'content' => 'require',
        'category_id' => 'require',
        'type' => 'require|in:reprinted,original',
        'phone' => 'require',
        'province_id' => 'require',
        'city_id' => 'require',
        'area_id' => 'require',
        'topic_ids'=>'require',
        'media_type'=>'require|in:image,video,mix'
    ];

    /**
     * 提示消息
     */
    protected $message = [
        'content.require' => '内容不能为空',
        'category_id.require' => '标签必选',
        'type.require' => '作品类型必选',
        'type.in' => '作品类型必须为original或reprinted',
        'phone.require' => '手机号必须填写',
        'province_id.require' => '省必选',
        'city_id.require' => '市必选',
        'area_id.require' => '区必选',
        'topic_ids.require' => '话题必选',
    ];

    /**
     * 字段描述
     */
    protected $field = [

    ];

    /**
     * 验证场景
     */
    protected $scene = [
        'index' => ['content', 'category_id', 'type','topic_ids', 'phone', 'province_id', 'city_id', 'area_id','media_type'],
    ];
}